package com.gbco.intelligentpush.async;

import com.alibaba.fastjson.JSONObject;
import com.gbco.intelligentpush.utils.JedisAdapter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class EventProducer{

    @Autowired
    JedisAdapter jedisAdapter;

    public void fireEvent(EventModel model){
        String message = JSONObject.toJSONString(model);
        jedisAdapter.lpush("async",message);
        log.info("one message put into async list : "+model.getEventType());
    }

}
